"""

"""
fo = open("PY202.txt","w")
data=input("请输入课程名及对应的成绩：")# 课程名　成绩
course_score_dict= {} 
sorce_max_subject_name= ""
sorce_max = 0
sorce_min_subject_name= ""
sorce_min = float('inf') # 无穷大
sum_source = 0
subject_num = 0
while data:
    subject=data.split(" ")
    sorce = float(subject[1])
    if sorce > sorce_max:
        sorce_max_subject_name= subject[0]
        sorce_max = sorce
    elif sorce< sorce_min:
        sorce_min_subject_name= subject[0]
        sorce_min = sorce
    sum_source +=sorce
    subject_num += 1
    data=input("请输入课程名及对应的成绩：")
average_sorce = sum_source/subject_num
fo.write("最高分课程是{}{}，最低分课程是{}{}，平均分是{:.2f}".format(sorce_max_subject_name,
                                                     sorce_max,
                                                     sorce_min_subject_name,
                                                     sorce_min,
                                                     average_sorce
                                                     ))
fo.close()
